<?php
namespace app\warehouse\admin;
use app\system\admin\Admin;
use app\warehouse\model\Warehouse as WarehouseModel;
use app\warehouse\model\Directtype as DirecttypeModel;
use app\shop\model\Shop as ShopModel;
class Directtype extends Admin
{
    protected $hisiModel = 'Directtype';//模型名称[通用添加、修改专用]
    protected $hisiTable = '';//表名称[通用添加、修改专用]
    protected $hisiAddScene = '';//添加数据验证场景名
    protected $hisiEditScene = '';//更新数据验证场景名

    public function index()
    {
        
        if ($this->request->isAjax()) {
            $where      = [];
            $page       = $this->request->param('page/d', 1);
            $limit      = $this->request->param('limit/d', 15);

            $data['data'] = DirecttypeModel::where($where)
                            ->page($page)
                            ->limit($limit)
                            ->order('sort asc,id desc')
                            ->select();
            $data['count'] = DirecttypeModel::where($where)->count('id');
            $data['code'] = 0;
            return json($data);

        }
        return $this->fetch();
    }
}
